home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / os2tools / bnklysrc / com_dos.h < prev    next >
Text File  |  1989-05-05  |  12KB  |  190 lines

  1. /*--------------------------------------------------------------------------*/
  2. /*                                                                          */
  3. /*                                                                          */
  4. /*      ------------         Bit-Bucket Software <no-Inc>                   */
  5. /*      \ 10001101 /         Writers and Distributors of                    */
  6. /*       \ 011110 /          No-Cost<no-tm> Software.                       */
  7. /*        \ 1011 /                                                          */
  8. /*         ------                                                           */
  9. /*                                                                          */
  10. /*  Copyright (C) 1987, 1988, 1989 by Robert Hartman and Vincent Perriello  */
  11. /*                                                                          */
  12. /*                                                                          */
  13. /*         Communications (FOSSIL) definitions for BinkleyTerm 2.10         */
  14. /*                                                                          */
  15. /*                                                                          */
  16. /*    For complete  details  of the licensing restrictions, please refer    */
  17. /*    to the License  agreement,  which  is published in its entirety in    */
  18. /*    the MAKEFILE and BT.C, and also contained in the file LICENSE.210.    */
  19. /*                                                                          */
  20. /*    USE  OF THIS FILE IS SUBJECT TO THE  RESTRICTIONS CONTAINED IN THE    */
  21. /*    BINKLEYTERM  LICENSING  AGREEMENT.  IF YOU DO NOT FIND THE TEXT OF    */
  22. /*    THIS  AGREEMENT IN ANY OF THE  AFOREMENTIONED FILES,  OR IF YOU DO    */
  23. /*    NOT HAVE THESE FILES,  YOU SHOULD  IMMEDIATELY CONTACT THE AUTHORS    */
  24. /*    AT THE  ADDRESSES LISTED BELOW.  IN NO EVENT SHOULD YOU PROCEED TO    */
  25. /*    USE   THIS  FILE  WITHOUT  HAVING   ACCEPTED  THE  TERMS  OF   THE    */
  26. /*    BINKLEYTERM  LICENSING AGREEMENT,  OR SUCH OTHER  AGREEMENT AS YOU    */
  27. /*    ARE ABLE TO REACH WITH THE AUTHORS.                                   */
  28. /*                                                                          */
  29. /*                                                                          */
  30. /*    The Authors can be reached at the following addresses:                */
  31. /*                                                                          */
  32. /*    Robert C. Hartman                      Vincent E. Perriello           */
  33. /*    Spark Software                         VEP Software                   */
  34. /*    427-3 Amherst Street                   111 Carroll Street             */
  35. /*    CS2032, Suite 232                      Naugatuck, CT 06770            */
  36. /*    Nashua, NH 03061                                                      */
  37. /*                                                                          */
  38. /*    FidoNet 1:132/101                      FidoNet 1:141/491              */
  39. /*    Data    (603) 888-8179                 Data    (203) 729-7569         */
  40. /*                                                                          */
  41. /*    Please feel free to contact us at any time to share your comments     */
  42. /*    about our software and/or licensing policies.                         */
  43. /*                                                                          */
  44. /*--------------------------------------------------------------------------*/
  45.  
  46.  
  47. /*--------------------------------------------------------------------------*/
  48. /* MACROS that call the routines in COM_ASM                                 */
  49. /*--------------------------------------------------------------------------*/
  50. extern      Com_           ();
  51. extern      Cominit        ();
  52. extern  int READBYTE();
  53. #define M_INSTALL(b)       {Cominit(com_port);Com_(0x0f,0);Com_(0x0f,handshake_mask);new_baud(0,b);}
  54.  
  55.  
  56.                            /*-----------------------------------------------*/
  57.                            /* Service 0: SET BAUD(etc)                      */
  58.                            /*-----------------------------------------------*/
  59. /*#define MDM_ENABLE(b)      (Com_(0x00,b|NO_PARITY|STOP_1|BITS_8))*/
  60.  
  61.                            /*-----------------------------------------------*/
  62.                            /* Service 1: SEND CHAR (wait)                   */
  63.                            /*-----------------------------------------------*/
  64. /*#define SENDBYTE(x)       (Com_(0x01,x))*/
  65.                            /*-----------------------------------------------*/
  66.                            /* Service 2: GET CHAR (wait)                    */
  67.                            /*-----------------------------------------------*/
  68. /*#define MODEM_IN()         (Com_(0x02)&0x00ff)*/
  69.  
  70.                            /*-----------------------------------------------*/
  71.                            /* Service 3: GET STATUS                         */
  72.                            /*-----------------------------------------------*/
  73. /*#define MODEM_STATUS()     (Com_(0x03))*/
  74. #define CARRIER            (Com_(0x03)&carrier_mask)
  75. #define CHAR_AVAIL()       (MODEM_STATUS()&DATA_READY)
  76. #define OUT_EMPTY()        (Com_(0x03)&TX_SHIFT_EMPTY)
  77. #define OUT_FULL()         (!(Com_(0x03)&TX_HOLD_EMPTY))
  78.  
  79.                            /*-----------------------------------------------*/
  80.                            /* Service 4: INIT/INSTALL                       */
  81.                            /*-----------------------------------------------*/
  82.  
  83.                            /*-----------------------------------------------*/
  84.                            /* Service 5: UNINSTALL                          */
  85.                            /*-----------------------------------------------*/
  86. /*#define MDM_DISABLE()      (Com_(0x05,BAUD_2400|NO_PARITY|STOP_1|BITS_8))*/
  87.  
  88.                            /*-----------------------------------------------*/
  89.                            /* Service 6: SET DTR                            */
  90.                            /*-----------------------------------------------*/
  91. #define DTR_OFF()          (Com_(0x06,0))
  92. #define DTR_ON()           (Com_(0x06,1))
  93.  
  94.                            /*-----------------------------------------------*/
  95.                            /* Service 7: GET TIMER TICK PARMS               */
  96.                            /*-----------------------------------------------*/
  97.  
  98.                            /*-----------------------------------------------*/
  99.                            /* Service 8: FLUSH OUTBOUND RING-BUFFER         */
  100.                            /*-----------------------------------------------*/
  101.  
  102.                            /*-----------------------------------------------*/
  103.                            /* Service 9: NUKE OUTBOUND RING-BUFFER          */
  104.                            /*-----------------------------------------------*/
  105. /*#define CLEAR_OUTBOUND()   (Com_(0x09))*/
  106.  
  107.                            /*-----------------------------------------------*/
  108.                            /* Service a: NUKE INBOUND RING-BUFFER           */
  109.                            /*-----------------------------------------------*/
  110. /*#define CLEAR_INBOUND()    (Com_(0x0a))*/
  111.  
  112.                            /*-----------------------------------------------*/
  113.                            /* Service b: SEND CHAR (no wait)                */
  114.                            /*-----------------------------------------------*/
  115. #define Com_Tx_NW(c)       (Com_(0x0b,c))
  116.  
  117.                            /*-----------------------------------------------*/
  118.                            /* Service c: GET CHAR (no wait)                 */
  119.                            /*-----------------------------------------------*/
  120. /*#define PEEKBYTE()         (Com_(0x0c))*/
  121.  
  122.                            /*-----------------------------------------------*/
  123.                            /* Service d: GET KEYBOARD STATUS                */
  124.                            /*-----------------------------------------------*/
  125. #define KEYPRESS()         (Com_(0x0d)!=(-1))
  126. #define FOSSIL_PEEKKB()    (Com_(0x0d))
  127.  
  128.                            /*-----------------------------------------------*/
  129.                            /* Service e: GET KEYBOARD CHARACTER (wait)      */
  130.                            /*-----------------------------------------------*/
  131. #define READKB()           (Com_(0x0e)&0xff)
  132. #define READSCAN()         (Com_(0x0e))
  133. #define FOSSIL_CHAR()      (Com_(0x0e))
  134.  
  135.  
  136.                            /*-----------------------------------------------*/
  137.                            /* Service f: SET/GET FLOW CONTROL STATUS        */
  138.                            /*-----------------------------------------------*/
  139. #define XON_ENABLE()       (Com_(0x0f,handshake_mask))
  140. #define XON_DISABLE()      (Com_(0x0f,(handshake_mask&(~USE_XON))))
  141. #define IN_XON_ENABLE()    (Com_(0x0f,handshake_mask|OTHER_XON))
  142. #define IN_XON_DISABLE()   (Com_(0x0f,(handshake_mask&(~OTHER_XON))))
  143.  
  144.                            /*-----------------------------------------------*/
  145.                            /* Service 10: SET/GET CTL-BREAK CONTROLS        */
  146.                            /*             Note that the "break" here refers */
  147.                            /*             to ^C and ^K rather than the      */
  148.                            /*             tradition modem BREAK.            */
  149.                            /*-----------------------------------------------*/
  150. #define _BRK_ENABLE()      (Com_(0x10,BRK))
  151. #define _BRK_DISABLE()     (Com_(0x10,0))
  152. #define RECVD_BREAK()      (Com_(0x10,BRK)&BRK)
  153.  
  154.                            /*-----------------------------------------------*/
  155.                            /* Service 11: SET LOCAL VIDEO CURSOR POSITION   */
  156.                            /*-----------------------------------------------*/
  157.  
  158.                            /*-----------------------------------------------*/
  159.                            /* Service 12: GET LOCAL VIDEO CURSOR POSITION   */
  160.                            /*-----------------------------------------------*/
  161.  
  162.                            /*-----------------------------------------------*/
  163.                            /* Service 13: WRITE LOCAL ANSI CHARACTER        */
  164.                            /*-----------------------------------------------*/
  165. #define WRITE_ANSI(c)       (Com_(0x13,c))
  166.                            /*-----------------------------------------------*/
  167.                            /* Service 14: WATCHDOG on/off                   */
  168.                            /*-----------------------------------------------*/
  169. #define FOSSIL_WATCHDOG(x) (Com_(0x14,x))
  170.                            /*-----------------------------------------------*/
  171.                            /* Service 15: BIOS write to screen              */
  172.                            /*-----------------------------------------------*/
  173. #define WRITE_BIOS(c) (Com_(0x15,c))
  174.  
  175.  
  176. /*--------------------------------------------------------------------------*/
  177. /*                                                                          */
  178. /* A no-stall ReadByte routine might look like this:                        */
  179. /*                                                                          */
  180. /*    int READBYTE()                                                        */
  181. /*       {                                                                  */
  182. /*       return( CHAR_AVAIL() ? MODEM_IN() : (-1) );                        */
  183. /*       }                                                                  */
  184. /*                                                                          */
  185. /*--------------------------------------------------------------------------*/
  186.  
  187.  
  188. /* END OF FILE: com.h */
  189.  
  190.